package com.mogician.qrrelay.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.RatingBar;
import android.widget.Toast;

import com.mogician.qrrelay.R;

public class GradeActivity extends AppCompatActivity
{

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_grade);

        RatingBar ratingBar = (RatingBar) findViewById(R.id.ratingbar);

        Button confirmBtn = (Button) findViewById(R.id.btn_confirm);
        confirmBtn.setOnClickListener(v->
        {
            Intent intent = new Intent();
            intent.putExtra("grade", (int)ratingBar.getRating());
            setResult(RESULT_OK, intent);
            finish();
        });
    }
}
